libxl: Spice image compression setting support for upstream qemu
authorFabio Fantoni <fabio.fantoni@m2r.biz>
Tue, 20 Jan 2015 10:26:30 +0000 (11:26 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 27 Jan 2015 16:40:57 +0000 (16:40 +0000)
Usage:
spice_image_compression=[auto_glz|auto_lz|quic|glz|lz|off]

Specifies what image compression is to be used by spice (if given),
otherwise the qemu default will be used.

Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
Acked-by: Wei Liu <wei.liu2@citrix.com>
docs/man/xl.cfg.pod.5
tools/libxl/libxl.h
tools/libxl/libxl_dm.c
tools/libxl/libxl_types.idl
tools/libxl/xl_cmdimpl.c

index e2f91fc201d65ce753feda42ffa0bf5275d6116c..0c2cbacc5dd32630e47150323bb27017cdf5b880 100644 (file)
@@ -1427,6 +1427,12 @@ for redirection of up to 4 usb devices from spice client to domU's qemu.
 It requires an usb controller and if not defined it will automatically adds
 an usb2 controller. The default is disabled (0).
 
+=item B<spice_image_compression=[auto_glz|auto_lz|quic|glz|lz|off]>
+
+Specifies what image compression is to be used by spice (if given), otherwise
+the qemu default will be used. Please see documentations of your current qemu
+version for details.
+
 =back
 
 =head3 Miscellaneous Emulated Hardware
index 0a123f197779acba01c656c01a66f39fcfb06a19..b8e0b675ed0863653cdcba5b1ff969bfe26b0111 100644 (file)
@@ -527,6 +527,17 @@ typedef struct libxl__ctx libxl_ctx;
  */
 #define LIBXL_HAVE_SPICE_USBREDIREDIRECTION 1
 
+/*
+ * LIBXL_HAVE_SPICE_IMAGECOMPRESSION
+ *
+ * If defined, then the libxl_spice_info structure will contain a string type
+ * field: image_compression. This value defines what Spice image compression
+ * is used.
+ *
+ * If this is not defined, the Spice image compression setting support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_IMAGECOMPRESSION 1
+
 /*
  * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
  *
index c2b0487c0ed2348972ce0820a3bb7e034d3db1f9..40c86499e4a213af69512f9a32c25aa06c05ff1f 100644 (file)
@@ -398,6 +398,10 @@ static char *dm_spice_options(libxl__gc *gc,
     if (!libxl_defbool_val(spice->clipboard_sharing))
         opt = libxl__sprintf(gc, "%s,disable-copy-paste", opt);
 
+    if (spice->image_compression)
+        opt = libxl__sprintf(gc, "%s,image-compression=%s", opt,
+                             spice->image_compression);
+
     return opt;
 }
 
index 1214d2eb8eeda32989c5d46f6646a09dbda8c163..052ded997eaa9600f46deb7f2b652de11f5986d3 100644 (file)
@@ -241,6 +241,7 @@ libxl_spice_info = Struct("spice_info", [
     ("vdagent",     libxl_defbool),
     ("clipboard_sharing", libxl_defbool),
     ("usbredirection", integer),
+    ("image_compression", string),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
index 0b02a6c0e2d9ef0aa3fbee4c3d97bbb0db55a538..00aa69dff50e8b4e3377613539e07a21d7b62308 100644 (file)
@@ -1948,6 +1948,8 @@ skip_vfb:
                             &b_info->u.hvm.spice.clipboard_sharing, 0);
         if (!xlu_cfg_get_long (config, "spiceusbredirection", &l, 0))
             b_info->u.hvm.spice.usbredirection = l;
+        xlu_cfg_replace_string (config, "spice_image_compression",
+                                &b_info->u.hvm.spice.image_compression, 0);
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
         xlu_cfg_get_defbool(config, "gfx_passthru",
                             &b_info->u.hvm.gfx_passthru, 0);